package org.zcl.mongo.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;

/**
 * .
 *
 * @author zhuchenglin
 * @since 2024/7/19 13:30
 */
@Document("demo")
@Data
public class User {

    @Id //当前类的 id 映射文档中的 _id
    private Integer id;
    private String name;
    private Integer age;
    @Field("work_day")  //当前类的 workDay 映射文档中的 work_day
    private Date workDay;
}
